package only.my.railgunys.shooting;

import only.my.railgunys.artifact.ArtifactSuitEffect;
import only.my.railgunys.artifact.imp.Emblem;
import only.my.railgunys.bean.Character;
import only.my.railgunys.bean.Enemy;
import only.my.railgunys.bean.Weapon;
import only.my.railgunys.repository.SceneRepository;
import only.my.railgunys.utils.FightUtils;
import only.my.railgunys.weapon.Deathmatch;
import only.my.railgunys.weapon.EngulfingLightning;
import only.my.railgunys.weapon.Harpoon;
import only.my.railgunys.weapon.PrimordialJadeWingedSpear;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

import static only.my.railgunys.preparation.SingleData.getSceneList;

@Component
public class RaidenShogun extends RoleScene {
    @Autowired
    SceneRepository sceneRepository;

    @Override
    Character specialIncrease(Character c){
        c.addIncrease((c.getRecharge() - 100)*0.4);
        c.addAtk(1.31*60);
        return c;
    }

    @Override
    public void calcWeaponData() {
        Weapon engulfingLightning = new EngulfingLightning(1);
        calcArtifactSuit(engulfingLightning);

        Weapon harpoon = new Harpoon(5);
        calcArtifactSuit(harpoon);

        Weapon primordialJadeWingedSpear = new PrimordialJadeWingedSpear(1,1);
        calcArtifactSuit(primordialJadeWingedSpear);
        calcArtifactSuit(new Deathmatch(3,1));
        calcArtifactSuit(new Deathmatch(3,2));
    }

    @Override
    protected void calcArtifactSuit(Weapon weapon) {
        ArtifactSuitEffect em = new Emblem();
        List<Character> characters3 = calcSuit4Sp(weapon, em);
        sceneRepository.saveAll(getSceneList(characters3));
    }

    @Override
    public void addTeam(Character character) {

    }

    @Override
    public Character initRoleBaseInfo() {
        Character raiden = new Character();
        raiden.setHp(12907.0);
        raiden.setRole(7);
        raiden.setLevel(90);
        raiden.setAtk(337.0);
        raiden.setCritDmg(50.0);
        raiden.setCritRate(5D);
        raiden.setDescription("90级雷神");
        raiden.setRecharge(132.0);
        raiden.setSkillDmg((721.44+7*60)/100);

        raiden.setAtkUseful(true);
        raiden.setIncrease(90*0.3);
        raiden.setRechargeUseful(true);
        raiden.setCritRateUseful(true);
        raiden.setElementDmgUseful(true);
        return raiden;
    }
}
